import requests

#这里测试搜索接口：
keyword = '大主宰'
keyword = keyword.encode('utf-8')
search_api_url = 'http://127.0.0.1:8000/qdnovel/api_search'
search_res = requests.post(search_api_url,data = {'keyword':keyword})
search_res.encoding = 'utf-8'
#print(search_res.json())

#这里测试首页接口：
home_api_url = 'http://127.0.0.1:8000/qdnovel/api_homepage'
home_page = 'homepage'
home_res = requests.post(home_api_url,data = {'home_page':home_page})
home_res.encoding = 'utf-8'
#print(home_res.json())

#这里测试某本小说接口：
novel_api_url= 'http://127.0.0.1:8000/qdnovel/api_novel_info'
novel_url = 'https://book.qidian.com/info/1013026063'
novel_res = requests.post(novel_api_url,data = {'novel_url':novel_url})
novel_res.encoding = 'utf-8'
print(novel_res.json())

